﻿@model IEnumerable<DFYE.Web.Models.guestBook>
@using DFYE.Web.Models;
@{
    ViewBag.Title = "topIndex";
}

<h2>家长留言</h2>

<table>
    <tr>
        <th>
            来至
        </th>
        <th>
            内容
        </th>
        <th>
            建立时间
        </th>
        <th>
            ip
        </th>
        <th>
            最近回复时间
        </th>

        <th>
            回复
        </th>

        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            [ <a href="/manage/guestbook/index/@item.studentID">@item.name</a> ]
        </td>
        <td>
            @item.content.tryHTMLSubstring(0, 50)
        </td>
        <td>
            @String.Format("{0:g}", item.datetime)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ip)
        </td>
        <td>
            @String.Format("{0:g}", item.replyDatetime)
        </td>

        <td>
            @if (item.able) { 
                <span style="color:red;">新</span>
            }else{
                
            }
        </td>

        <td>
            @Html.ActionLink("回复", "reply", new { id=item.ID }) |
            @Html.ActionLink("编辑", "edit", new { id=item.ID }) |
            @Html.ActionLink("删除", "Delete", new { id=item.ID })
        </td>
    </tr>
}

</table>
